package com.shooker.proxy.jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @Description
 * @Author zhousl
 * @Date 2023/4/23 20:21
 */
public class JdkProxy implements InvocationHandler {

    //目标对象
    private Object targetObject;

    //构造方法获取目标对象
    public JdkProxy(Object target){
        this.targetObject = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        // TODO 业务处理
        return method.invoke(targetObject,args);
    }
}
